home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11110 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  857 b 

  1. Path: news.uh.edu!pmn12564
  2. From: pmn12564@Bayou.UH.EDU (pat neff)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Input from non-ASCII keys
  5. Date: 12 Mar 1996 18:58:34 GMT
  6. Organization: University of Houston
  7. Message-ID: <4i4hgq$gaj@masala.cc.uh.edu>
  8. References: <4hrg9e$565@news.voicenet.com>
  9. NNTP-Posting-Host: bayou.uh.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. deaton@cygnus.rsabbs.com wrote:
  13.  
  14. :    Does anyone know how to get input from the arrow-keys and the page-up/page-down keys?
  15.  
  16. :  deaton@cygnus.rsabbs.com
  17.  
  18.     These keys are special keys on the PC.  In Borland (I'm sure MS C is 
  19. the same), you need to do a normal getch.  If it is NULL, then the next
  20. key will be the special key.  For PAGEDOWN:
  21.  
  22. char ch;
  23.  
  24. ch = getch ();
  25. if (!ch)
  26. {
  27.    ch = getch();
  28.    if (ch == 0x51)
  29.       puts ("pagedown was pressed");
  30.    else
  31.       puts ("special key was pressed");
  32. }
  33.  
  34.